package com.hyl.controller;

import com.hyl.domain.Entity.Customer;
import com.hyl.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author hyl
 * @description
 * @create 2025-06-20 09:35
 */
@Controller
public class CustomerController {
    @Autowired
    private CustomerService customerService;
    /**
     * 根据id查询客户详情
     */
    @RequestMapping("/findCustomerById")
    public ModelAndView findCustomerById(Integer id) {
        Customer customer = customerService.findCustomerById(id);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("customer");
        modelAndView.addObject("customer",customer);
        //返回客户信息展示页面
        return modelAndView;
    }

}
